/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bd_imss;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Earving
 */
@Entity
@Table(name = "pacientes")
@NamedQueries({
    @NamedQuery(name = "Pacientes.findAll", query = "SELECT p FROM Pacientes p"),
    @NamedQuery(name = "Pacientes.findByNumSS", query = "SELECT p FROM Pacientes p WHERE p.numSS = :numSS"),
    @NamedQuery(name = "Pacientes.findByCurp", query = "SELECT p FROM Pacientes p WHERE p.curp = :curp"),
    @NamedQuery(name = "Pacientes.findByNombre", query = "SELECT p FROM Pacientes p WHERE p.nombre = :nombre"),
    @NamedQuery(name = "Pacientes.findByApp", query = "SELECT p FROM Pacientes p WHERE p.app = :app"),
    @NamedQuery(name = "Pacientes.findByApm", query = "SELECT p FROM Pacientes p WHERE p.apm = :apm"),
    @NamedQuery(name = "Pacientes.findByTelefono", query = "SELECT p FROM Pacientes p WHERE p.telefono = :telefono"),
    @NamedQuery(name = "Pacientes.findByEdad", query = "SELECT p FROM Pacientes p WHERE p.edad = :edad"),
    @NamedQuery(name = "Pacientes.findByFechaNac", query = "SELECT p FROM Pacientes p WHERE p.fechaNac = :fechaNac"),
    @NamedQuery(name = "Pacientes.findByFechaIng", query = "SELECT p FROM Pacientes p WHERE p.fechaIng = :fechaIng"),
    @NamedQuery(name = "Pacientes.findByTipoSangre", query = "SELECT p FROM Pacientes p WHERE p.tipoSangre = :tipoSangre"),
    @NamedQuery(name = "Pacientes.findByIdConsultorio", query = "SELECT p FROM Pacientes p WHERE p.idConsultorio = :idConsultorio")})
public class Pacientes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "numSS")
    private String numSS;
    @Basic(optional = false)
    @Column(name = "curp")
    private String curp;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @Column(name = "app")
    private String app;
    @Column(name = "apm")
    private String apm;
    @Column(name = "telefono")
    private String telefono;
    @Basic(optional = false)
    @Column(name = "edad")
    private int edad;
    @Basic(optional = false)
    @Column(name = "fecha_nac")
    @Temporal(TemporalType.DATE)
    private Date fechaNac;
    @Basic(optional = false)
    @Column(name = "fecha_ing")
    @Temporal(TemporalType.DATE)
    private Date fechaIng;
    @Column(name = "tipo_sangre")
    private String tipoSangre;
    @Column(name = "id_consultorio")
    private Integer idConsultorio;
    @JoinColumn(name = "id_clinica", referencedColumnName = "id_clinica")
    @ManyToOne
    private Clinicas clinicas;
    @JoinColumn(name = "id_genero", referencedColumnName = "id_genero")
    @ManyToOne
    private Generos generos;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pacientes")
    private List<Citas> citasList;

    public Pacientes() {
    }

    public Pacientes(String numSS) {
        this.numSS = numSS;
    }

    public Pacientes(String numSS, String curp, String nombre, String app, int edad, Date fechaNac, Date fechaIng) {
        this.numSS = numSS;
        this.curp = curp;
        this.nombre = nombre;
        this.app = app;
        this.edad = edad;
        this.fechaNac = fechaNac;
        this.fechaIng = fechaIng;
    }

    public String getNumSS() {
        return numSS;
    }

    public void setNumSS(String numSS) {
        this.numSS = numSS;
    }

    public String getCurp() {
        return curp;
    }

    public void setCurp(String curp) {
        this.curp = curp;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getApp() {
        return app;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public String getApm() {
        return apm;
    }

    public void setApm(String apm) {
        this.apm = apm;
    }

    public String getTelefono() {
        return telefono;
    }

    public void setTelefono(String telefono) {
        this.telefono = telefono;
    }

    public int getEdad() {
        return edad;
    }

    public void setEdad(int edad) {
        this.edad = edad;
    }

    public Date getFechaNac() {
        return fechaNac;
    }

    public void setFechaNac(Date fechaNac) {
        this.fechaNac = fechaNac;
    }

    public Date getFechaIng() {
        return fechaIng;
    }

    public void setFechaIng(Date fechaIng) {
        this.fechaIng = fechaIng;
    }

    public String getTipoSangre() {
        return tipoSangre;
    }

    public void setTipoSangre(String tipoSangre) {
        this.tipoSangre = tipoSangre;
    }

    public Integer getIdConsultorio() {
        return idConsultorio;
    }

    public void setIdConsultorio(Integer idConsultorio) {
        this.idConsultorio = idConsultorio;
    }

    public Clinicas getClinicas() {
        return clinicas;
    }

    public void setClinicas(Clinicas clinicas) {
        this.clinicas = clinicas;
    }

    public Generos getGeneros() {
        return generos;
    }

    public void setGeneros(Generos generos) {
        this.generos = generos;
    }

    public List<Citas> getCitasList() {
        return citasList;
    }

    public void setCitasList(List<Citas> citasList) {
        this.citasList = citasList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (numSS != null ? numSS.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pacientes)) {
            return false;
        }
        Pacientes other = (Pacientes) object;
        if ((this.numSS == null && other.numSS != null) || (this.numSS != null && !this.numSS.equals(other.numSS))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bd_imss.Pacientes[numSS=" + numSS + "]";
    }

}
